<template>
	<div>
		<el-dialog title="查看详情" width="80%" @open="open" class="icon-dialog" :visible.sync="show" :before-close="closeForm" append-to-body>
      <el-form>
        <el-row>
          <el-col :span="6">
            <el-form-item :label="$t('field.PurchaseOrder_billNo')">{{header.billNo}} </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item :label="$t('field.PurchaseOrder_orderNo')">{{header.orderNo}} </el-form-item>
          </el-col>

        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item :label="$t('field.PurchaseOrder_createTime')">{{header.createTime}} </el-form-item>
          </el-col>


        </el-row>
      </el-form>

      <el-table :data="dataList" height="calc(100vh - 250px)">
        <el-table-column label="No." width="60" align="right" type="index"></el-table-column>
        <el-table-column label="物料编码" width="120" prop="materialNo"></el-table-column>
        <el-table-column label="物料名称" width="120" prop="materialName"></el-table-column>
        <el-table-column label="物料规格" width="120" prop="specification"></el-table-column>
        <el-table-column label="单位" width="60" prop="unit"></el-table-column>
        <el-table-column label="批号" width="80" prop="batchNo"></el-table-column>
        <el-table-column label="采购数量" width="60" prop="count"></el-table-column>
        <el-table-column label="交货日期" width="150" prop="deliveryDate"></el-table-column>
        <el-table-column label="单价" width="100" prop="price"></el-table-column>
        <el-table-column label="含税单价" width="100" prop="taxPrice"></el-table-column>
        <el-table-column label="折扣率(%)" width="100" prop="discountRate"></el-table-column>
        <el-table-column label="金额" width="100" prop="billAmount"></el-table-column>
        <el-table-column label="税额" width="100" prop="taxAmount"></el-table-column>
        <el-table-column label="税率" width="100" prop="entryTaxRate"></el-table-column>
        <el-table-column label="价税合计" width="100" prop="billAllAmount"></el-table-column>
        <el-table-column label="是否赠品" width="100" prop="giveAway"></el-table-column>
      </el-table>
		</el-dialog>
	</div>
</template>
<script>
import { detail  } from '@/api/app/purchaseorder'
export default {
	name:'purchaseOrderdetail',
	props: {
		show: {
			type: Boolean,
			default: true
		},
		size: {
			type: String,
			default: 'mini'
		},
		info: {
			type: Object,
		},
	},
	data() {
		return {
			header:{},
      dataList:[]
		}
	},
	watch:{
		show(val){
			if(val){
			}
		}
	},
	methods: {
		open(){
			detail(this.info).then(res => {
				this.header = res.data.header
        this.dataList = res.data.dataList
			})
		},
		closeForm(){
			this.$emit('update:show', false)
		}
	}
}
</script>
<style  lang="scss">
@import '@/assets/scss/common.scss';
</style>
